home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_200
/
238_01
/
init.c
< prev
next >
Wrap
Text File
|
1987-07-26
|
768b
|
35 lines
#include <stdio.h>
extern int TEN_MS;
GRADinit()
{
int count;
long curtime, time();
#ifdef JLASER
if (initjlsr()==ERROR) {
fprintf(stderr,"Unable to initialize JLASER\n");
exit(1);
}
#endif
count=0;
curtime=time(NULL);
while (curtime==time(NULL));
curtime=time(NULL);
count++;
while (curtime==time(NULL)) count++;
TEN_MS=(int) (333L *count/187); /* 333 empty loops in IBM PC takes 10ms
IBM PC gives a average of 187 count */
}
cleanup(exitcode)
{
#ifdef JLASER
cleanjlsr();
#endif
if (exitcode) /* if exitcode is non-zero, error exit */
exit(exitcode);
}